﻿// ***********************************************************************
// Assembly         : INNOVACALL.Framework.Common
// Author           : LJO+01 (Laurent Jordi)
// Created          : 06-05-2013
// Last Modified By : LJO+01 (Laurent Jordi)
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="CountryService.cs" company="Copyright © Innovacall 2011">
//     Copyright (c) Copyright © Innovacall 2011. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;

namespace INNOVACALL.Framework.Common.CountryCurrencyService
{
    /// <summary>
    /// Class CountryService
    /// </summary>
	public class CountryService
	{
        /// <summary>
        /// Gets the start with.
        /// </summary>
        /// <param name="term">The term.</param>
        /// <param name="count">The count.</param>
        /// <returns>IEnumerable{System.String}.</returns>
		public IEnumerable<string> GetStartWith(string term, int count)
		{
			if (term == null)
			{
				return null;
			}
			return Country.GetValues().Where(i => i.LocalizedName.StartsWith(term, StringComparison.InvariantCultureIgnoreCase)).Select(i => i.LocalizedName).Take(count);
		}
	}
}